﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SDT.Model.Country>>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%@ Import Namespace="SDT.Admin.ViewModels" %>
<%@ Import Namespace="SDT.Model"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Quốc gia
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if(ViewData["MessageInfo"]==null){ %>
	<form action="/Country" method="post" name="adminForm">
		<table width="100%" class="adminlist">
			<tr>
				<th width="10" align="right">
					STT
				</th>
				<th width="30"></th>
				<th width="30"></th>
				<th>
					Mã
				</th>
				<th>
					Tên
				</th>
				<th>
					ID
				</th>
			</tr>
		<% 
			int i = 0;
    		foreach (var item in Model) {
				i++;
		%>		
			<tr>
				<td align="right">
					<%= i.ToString() %>
				</td>
				<td align="center">
					<%= Html.ActionImage("Sửa", "icon-24-edit.png", "Country", "Edit", new Dictionary<string, object>() { { "id", item.ID } })%>
				</td>
				 <td align="center">
					<%= Html.ActionImage("Xóa", "icon-24-delete.png", "Country", "Delete", new Dictionary<string, object>() { { "id", item.ID } })%>
				</td>
				<td>
					<%= item.CountryCode%>
				</td>
				<td>
					<%= item.CountryName%>
				</td>
				<td>
					<%= Html.Encode(item.ID) %>
				</td>
			</tr>
	    
		<% } %>

		</table>
		<%= Html.Hidden("order")%>
		<%= Html.Hidden("orderDir")%>
	</form>
<% } %>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Header" runat="server">
	Quốc gia
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%> 
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="Toolbar" runat="server">
	<%= Html.Toolbar("Thêm mới", "/Country/Create", "new")%>
</asp:Content>

